package org.opens.guava.utilites.eventBus.listeners;

import com.google.common.eventbus.Subscribe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ExceptionListener {

    private final static Logger LOGGER = LoggerFactory.getLogger(ExceptionListener.class);

    @Subscribe
    public void doAction1(String event) {
        LOGGER.info("the event: [{}] handle by {}.{}", event, this.getClass().getSimpleName(), "doAction1");
    }

    @Subscribe
    public void doAction2(String event) {
        LOGGER.info("the event: [{}] handle by {}.{}", event, this.getClass().getSimpleName(), "doAction2");
    }

    @Subscribe
    public void doAction3(String event) {
        LOGGER.info("the event: [{}] handle by {}.{}", event, this.getClass().getSimpleName(), "doAction3");
        throw new RuntimeException("假设发生了异常");
    }

}
